package owg.util.awt.cursor;

import static java.awt.Cursor.*;

import java.awt.Cursor;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;

import javax.imageio.ImageIO;

public class Cursors
	{
	public static final Cursor[] CURSOR_SCALE ={Cursor.getPredefinedCursor(E_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(NE_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(N_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(NW_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(W_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(SW_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(S_RESIZE_CURSOR),
												Cursor.getPredefinedCursor(SE_RESIZE_CURSOR)};
	
	public static final Cursor DEFAULT_CURSOR 	= Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
	public static final Cursor HAND_CURSOR 		= Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
	public static final Cursor MOVE_CURSOR 		= Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR);
	public static final Cursor CROSSHAIR_CURSOR = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
	public static final Cursor WAIT_CURSOR 		= Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
	public static final Cursor TEXT_CURSOR 		= Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);

	
	public static Cursor NO_CURSOR,ROTATE_CURSOR,ADD_CURSOR,SUBTRACT_CURSOR,MULTIPLY_CURSOR,RESIZE_CURSOR,PENCIL_CURSOR, INVALID_CURSOR;
	static
		{
		NO_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB), new Point(0, 0), "none");
		try
			{
			ROTATE_CURSOR 	= Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorRotate.png"))  , new Point(2,28) , "Rotate");
			ADD_CURSOR 		= Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorAdd.png"))     , new Point(15,15), "Add");
			INVALID_CURSOR 	= Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorInvalid.png"))     , new Point(15,15), "Invalid");
			SUBTRACT_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorSubtract.png")), new Point(15,15), "Subtract");
			MULTIPLY_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorMultiply.png")), new Point(15,15), "Multiply");
			RESIZE_CURSOR   = Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorResize.png")), new Point(15,15), "Resize");
			PENCIL_CURSOR   = Toolkit.getDefaultToolkit().createCustomCursor(ImageIO.read(Cursors.class.getResourceAsStream("/owg/util/awt/cursor/cursorPencil.png")), new Point(7,23), "Pencil");
			}
		catch (Exception e)
			{e.printStackTrace();}
		}
	}
